﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace AlertSystem.Dab.MoneyOperations
{
    public class MoneyAlertItem : IAlertItem
    {
        public string Id { get; private set; }
        public string UserName { get; private set; }
        public string UserId { get; private set; }
        public DateTime DateCreate { get; private set; }
        public DateTime DateEdit { get; private set; }
        public string Value { get; private set; }
        public object Data { get; private set; }
        public string Comment { get; private set; }
        public string SysAlertName { get { return "ДС: Операции ввода/вывода"; } }

        public MoneyAlertItem(DataRow r)
        {
            Id = r["Id"].ToString();
            UserId = r["UserId"].ToString();
            UserName = r["UserName"].ToString();
            Value = string.Format("{0:#.00}", r["Value"]);
            Comment = r["Comment"].ToString();
            DateCreate = DateTime.Parse(r["DateCreate"].ToString());
        }
    }
}
